import * as lib from '../../../../components/aotoo/lib/index'
const commonHooks = lib.hooks('calender-announce', true)

const version = {version: '1.10'}

// 公告
const announcementConfig = {
  height: 45,
  width: 80,
  title: '1.10 更新',
  content: `1. 优化核心库性能
  2. 优化版面样式
  3. 新增背景图片
  4. 优化交互体验`
}

export function announcePop(){
  const announcement = commonHooks.getItem('announcement')
  if (!announcement) {
    wx.modalx.showAnnounce(announcementConfig)
    commonHooks.setItem('announcement', version)
  } else {
    if (announcement.version !== version.version) {
      wx.modalx.showAnnounce(announcementConfig)
      commonHooks.setItem('announcement', version)
    }
  }
}